package com.example.usbtest;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Context;
import android.hardware.usb.UsbDevice;
import android.hardware.usb.UsbManager;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.zkteco.biometric.USBTest;

import java.util.HashMap;

public class MainActivity extends AppCompatActivity {
    private TextView textView = null;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        textView = (TextView)findViewById(R.id.textResult);
    }


    public void onBnEnum(View view)
    {
        UsbManager mManager = (UsbManager) this.getSystemService(Context.USB_SERVICE);
        HashMap<String, UsbDevice> deviceList = mManager.getDeviceList();

        textView.setText("");
        USBTest.test();
    }

    public void onBnGetAll(View view)
    {
        String strRet = USBTest.getalldevice();
        textView.setText(strRet);
    }
}
